import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: '/article',
    name: 'article',
    component: () => import('../views/Article.vue'),
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue'),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
  },
  {
    path: '/',
    redirect: '/home/index',
  },
  {
    // 主页
    path: '/index',
    name: 'index',
    component: () => import('../views/Index.vue'),
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    redirect: '/home/index',
    children: [{
      // 二级路由跳转到首页页面
      path: 'index',
      name: '/home/index',
      component: () => import('../views/Index.vue'),
    }, 
    {
      path:'zhaodianzhuang',
      name:'zhaodianzhuang',
      component: () => import('../views/ZhaoDianZhuang.vue')
    },
    {
      path:'shequ',
      name:'shequ',
      component: () => import('../views/SheQu.vue')
    },
    {
      path: "mine",
      name: "mine",
      component: () => import("../views/Mine.vue"),
    },
    {
      path: 'news',
      name: 'news',
      component: () => import('../views/News.vue'),
    },
  ]
  },
  {
    // 轮播图1
    path: '/lunbo1',
    name: 'lunbo',
    component: () => import('../lunbo/LunBo1.vue'),
  },
  {
    // 轮播图2
    path: '/lunbo2',
    name: 'lunbo',
    component: () => import('../lunbo/LunBo2.vue'),
  },
  {
    // 轮播图2
    path: '/lunbo3',
    name: 'lunbo',
    component: () => import('../lunbo/LunBo3.vue'),
  },
  {
    path: '/Commodity',
    name: 'Commodity',
    component: () => import('../views/Commodity.vue'),
  },
  {
    path: '/shoucang',
    name: 'shoucang',
    component: () => import('../views/shoucang.vue'),
  },
  {
    path: '/detail',
    name: 'detail',
    component: () => import('../views/Detail.vue'),
  },
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/Index.vue'),
  },
  {
    path: '/amap',
    name: 'amap',
    component: () => import('../views/Amap.vue'),
  },
  {
    path: '/pay',
    name: 'pay',
    component: () => import('../views/Pay.vue'),
  },
  // {
  //   path: "/",
  //   redirect: "/home/quanbu",
  // },
  {
    path: "/news",
    name: "news",
    component: () => import("../views/News.vue"),
  },
  {
    path: "/dingdan",
    name: "dingdan",
    component: () => import("../views/Dingdan.vue"),
    // children: [
    //   {
    //     path: "quanbu",
    //     component: () => import("../views/Quanbu.vue"),
    //   },
    // ],
  },
  {
    path: "/dingdan/quanbu",
    component: () => import("../views/Quanbu.vue"),
  },
  {
    path: "/",
    name: "home",
    component: HomeView,
    // children: [
    //   {
    //     path: "/quanbu",
    //     component: () => import("../components/Quanbu.vue"),
    //   },
    // ],
  },
  {
    path: "about",
    name: "about",
    component: () => import("../views/AboutView.vue"),
  },
  
  {
    path: "/preference",
    name: "preference",
    component: () => import("../views/preference.vue"),
  },
  {
    path: "/charge",
    name: "charge",
    component: () => import("../views/Charge.vue"),
  },
  {
    path: "/tidings",
    name: "tidings",
    component: () => import("../views/Tidings.vue"),
  },
  {
    path: "/zhifu",
    name: "zhifu",
    component: () => import("../views/ZhiFu.vue"),
  },
  
  
  {
    path: '/article',
    name: 'article',
    component: () => import('../views/Article.vue'),
  },
  {
    path:'/aiche',
    name:'aiche',
    component: () => import('../views/AiChe.vue')
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
